import bargainApi from "@/api/declaration/mall/bargainApi"
import httpRequest from "@/config/axios/httpRequest"
import { BargainActivityModel } from "@/models/mall/BargainActivityModel"


// 查询砍价活动列表
export const getBargainActivityPage = async (params: any) => {
  return await httpRequest.get(bargainApi.GetBargainActivityPage,params)
}

// 查询砍价活动详情
export const getBargainActivity = async (id: number) => {
  return await httpRequest.get(bargainApi.GetBargainActivity, { params: { id } })
}

// 新增砍价活动
export const createBargainActivity = async (data: BargainActivityModel) => {
  return await httpRequest.post(bargainApi.CreateBargainActivity, data)
}

// 修改砍价活动
export const updateBargainActivity = async (data: BargainActivityModel) => {
  return await httpRequest.put(bargainApi.UpdateBargainActivity, data)
}

// 关闭砍价活动
export const closeBargainActivity = async (id: number) => {
  return await httpRequest.put(bargainApi.CloseBargainActivity, { id })
}

// 删除砍价活动
export const deleteBargainActivity = async (id: number) => {
  return await httpRequest.delete(bargainApi.DeleteBargainActivity, { params: { id } })
}
